package com.example.zookeeper.rmi.service.impl;

import com.example.zookeeper.rmi.service.HelloService;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class HelloServiceImpl extends UnicastRemoteObject implements HelloService
{
    private static final long serialVersionUID = -5406284964233277743L;

    private int port = 1009;

    public HelloServiceImpl() throws RemoteException
    {

    }

    public void setPort(int port)
    {
        this.port = port;
    }

    @Override
    public String sayHello(String name) throws RemoteException
    {
        return "hello " + name + " port: " + port;
    }
}
